home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
dev
/
cross
/
dass05sc.lha
/
readme.doc
< prev
Wrap
Text File
|
1995-08-28
|
11KB
|
304 lines
dass05sc - version 0.9 (27.08.1995)
(c)1995 by Klaus Hegemann
INTRODUCTION:
dass05sc allows you to monitor/disassemble binary data of at least
the Motorola MC68HC05SC21 smart card microcontroller.
Command line operation is supported as well as a 'batch' like control-
file operation (recommended).
FOR THE QUICKSTARTERS: have a look at the EXAMPLES at the end of
this text.
There are slight differences between the Amiga and the PC version of
this program concerning the command line syntax. Have a look at
'DIFFERENCES'
BACKGROUND:
Well, it was hard enough to find a disassembler for the 68hc05 type
microprocessor until I was told that the 68hc05_SC_ makes use of a
modified coding of the instruction byte. :-| And, as far as I searched
some of the 'motorola stuff'-filled ftp servers and the motorola bbs
itself in Germany there seemed to be no disassembler for this type of uP
publicly available. Thanks to Marc Wirth who responded to my complains
;-) and supplied me with information about the smart card version of the
hc05. To cut it short: There was no disassembler, so I had to write one.
As a result, I added some more features and decided to make it public
available.
USAGE:
AmigaOS Template: BINFILE/A,CONTROLFILE=CF/K,START=S/K,END=E/K,
OFFSET=O/K,PLUSHEXDUMP=DM/S,HEXONLY=M/S
general Information on template usage:
'/A': required argument; '/K': keyword, must be placed in front of the
argument; '/S': switch option; 'WORD1=W1': WORD1 and W1 do have the
same meaning. Use as keyword or switch.
BINFILE: Filename of the binary to be disassembled.
CONTROLFILE=CF: Option: 'batch'-like operation mode (see below). No
further command line args needed, except the BINFILEname.
command line operation:
START=S: Specify the start location within the binary for
disassembly and hexdump
END=E: end location for disassembly/hex dump. If not specified
a default of 20 output lines is set.
OFFSET=O: If your binary proviedes relocated code, you may specify
a signed value to cause the output to appear at a correct
location. E.g. your binary contains the smart card memory
image $0000 - $1fff with activated 1st codepage and
from $2000 - $3fff with activated second codepage:
simply specify an offset of -$2000 when inspecting code
of the second code page.
PLUSHEXDUMP=DM: An additional hex dump is placed on the right side near
the disassebled output. Useful e.g. to distinguish
between wild code and ascii text...
HEXONLY=M: Memory hex-dump option.
EXAMPLES: CLI
>dass05sc t:bin start=$1000
>dass05sc t:bin start $1000
>dass05sc t:bin s=$1000
>dass05sc t:bin s=4096
they all produce the same output:
====================<begin>====================================
*** dass05sc V0.9 disassembler for 68hc05sc21 type binaries ***
(w)1995 by Klaus Hegemann. Freely distributable.
read 16384 data bytes from file 'bin'
1000: 00 rti
1001: 00 rti
1002: 00 rti
1003: 00 rti
1004: 00 rti
1005: 00 rti
1006: 00 rti
1007: 00 rti
1008: 00 rti
1009: 00 rti
100a: 00 rti
100b: 00 rti
====================<end>======================================
>dass05sc t:bin hexonly start=$1000 end=$1020
>dass05sc t:bin m start=$1000 end=$1020
>dass05sc t:bin m start=4096 end=4128
each one results in:
====================<begin>====================================
[...]
read 16384 data bytes from file 't:bin'
1000: 00 00 00 00 00 00 00 00 '........'
1008: 00 00 00 00 00 00 00 00 '........'
1010: 00 00 00 00 00 00 00 00 '........'
1018: 00 00 00 00 00 00 00 00 '........'
1020: 00
====================<end>======================================
>dass05sc t:bin plushexdump start=$07e9 end=$07fd offset=-$07e9
>dass05sc t:bin dm s=$07e9 e=$07fd o=-$07e9
each one results in:
====================<begin>====================================
[...]
read 16384 data bytes from file 't:bin'
0000: 2f txa 0000: 2f 4d 1d 3d 3f 87 37 ' /M.=?.7'
0001: 4d 1d 3d jsr $1d3d
0004: 3f 87 stx $87
0006: 37 95 sta $95 0007: 95 3b 96 93 3a 3b 93 97 '.;..:;..'
0008: 3b 96 ldx $96
000a: 93 3a bne $0046
000c: 3b 93 ldx $93
000e: 97 04 beq $0014 000f: 04 16 06 96 32 3b '....2; '
0010: 16 06 cpx #$06
0012: 96 32 bls $0046
0014: 3b a6 ldx $a6
====================<end>======================================
EXAMPLES: CONTROLFILE:
In controlfile operation there are some differences/additions:
The line:
e "***"
simply outputs the chars between the two (")s
d <start> <end> <offset>
will disassemble from <start> to <end> with an offset of <offset>
No keywords are allowed. <start> and <end> must be specified,
<offset> may not. You may use hexadecimal Numbers, introduced
by a '$'. If not, the line parser expects a decimal value.
d- <start> <end> <offset>
Suppresses additional blank lines after JMPs, BRAs, STOPs, WAITs,
etc.
m <start> <end> <offset>
Memory hex-dump
dm- <start> <end> <offset>
Disassembler dump with additional hex dump, no extra blank lines
after JMPs, BRAs, etc...
controlfile 't:control' consists of (without the '>'):
====================<begin>====================================
e "***************************************"
e "* lots of zero's *"
e "***************************************"
m $052a $0543 -$0100
e "***************************************"
e "* some machine code *"
e "***************************************"
d $0573 $057c
e "***************************************"
e "* and now with additional hex dump *"
e "***************************************"
dm $0573 $057c -$73
e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
e "% in jump tables there is no need for %"
e "% empty lines after JMPs, BRAs,... %"
e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
d- $0573 $057c -$73
e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
dm- $0573 $057c -$73
====================<end>======================================
will be used by dass05sc if you supply the 'CONTROLFILE' keaword:
>dass05sc t:bin controlfile=t:control
>dass05sc t:bin cf=t:control
that will cause the following output:
====================<begin>====================================
*** dass05sc V0.9 disassembler for 68hc05sc21 type binaries ***
(w)1995 by Klaus Hegemann. Freely distributable.
read 16384 data bytes from file 't:bin'
***************************************
* lots of zero's *
***************************************
042a: 00 00 00 00 00 00 ' ......'
0430: 00 00 00 00 00 00 00 00 '........'
0438: 00 00 00 00 00 00 00 00 '........'
0440: 00 00 00 00 '.... '
***************************************
* some machine code *
***************************************
0573: 49 13 bf jmp $13bf
0576: 49 14 93 jmp $1493
0579: 49 14 cf jmp $14cf
057c: 49 14 ab jmp $14ab
***************************************
* and now with additional hex dump *
***************************************
0500: 49 13 bf jmp $13bf 0500: 49 13 bf 49 14 ' I..I.'
0503: 49 14 93 jmp $1493 0505: 93 49 14 cf 49 '.I..I '
0506: 49 14 cf jmp $14cf
0509: 49 14 ab jmp $14ab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% in jump tables there is no need for %
% empty lines after jmps, bras,... %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0500: 49 13 bf jmp $13bf
0503: 49 14 93 jmp $1493
0506: 49 14 cf jmp $14cf
0509: 49 14 ab jmp $14ab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0500: 49 13 bf jmp $13bf 0500: 49 13 bf 49 14 ' I..I.'
0503: 49 14 93 jmp $1493 0505: 93 49 14 cf 49 '.I..I '
0506: 49 14 cf jmp $14cf
0509: 49 14 ab jmp $14ab
====================<end>======================================
In controlfile operation you are supposed to prefer a file
in wich the information should be dumped.
To achieve that, simply use the output redirect option that
comes with your DOS: (Amiga and PC as well)
>dass05sc t:bin controlfile=t:control >disassembled.txt
>dass05sc t:bin cf=t:control >disassembled.txt
DIFFERENCES: (usage Amiga <-> PC)
Only the command line hanling is concerned. On the Amiga, I prefered
using the command line parser that comes with AmigaOS, rather than
the ANSI parser supplied with the C-Compiler.
On the PC the command line usage is almost the same:
* you must supply the keywords in its short form.
(e.g. 'CF' insted of 'CONTROLFILE')
* you must supply a '=' after the keywords.
Maximum binary size : Amiga=64k PC=32k
BUGS:
No error messages yet, it simply quits if something's wrong.
I suggest that you may provoke a crash, if the cli/controlfile syntax
becomes too obscure...
All in all and as you can see it at the version number, this proggi
is still a kind of 'beta', quick & dirty... but right now there are
other things (i.e. the next exams) that I ought to worry about.
DISCLAIMER/DISTRIBUTION:
Both programs, the Amiga and the PC version of this program are
freely distributible, but they are not public domain.
The contents of this distribution are copyrigthed matrial, and may not
be altered without express permission of the author.
dass05sc may be distributed by any means, electronic or physical,
provided no charge, other than for small handling fees such as disk
medium charges, is made. It may be distributed on commercial electronic
networking services, provided that no fee is made explicitly for it's
acquirement, though a general blanket downloading charge is permissable.
Inclusion on the Aminet and Fred Fish CDs is welcomed due to their long
standing support of the Amiga.
I am in no way responsible in any damage that may result in using this
program or in using of its output. There is no warranty of any kind.
archive contents:
AmiDass05sc 19552 bytes executable for Amiga
PcDass05sc.exe 52754 bytes executable for PC
readme.doc 11460 bytes this text
AUTHOR:
Klaus Hegemann klausi@higgens.tng.oche.de
Hirschgraben 13 hegeman@reze-1.rz.rwth-aachen.de
52062 Aachen
-Germany-